package com.jie.other.ui.list_choose_dialog

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material.Divider
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.jie.other.ui.theme.colorGrayLine

@Composable
fun ListChooseItemView(
    itemDTO: ListItemDTO,
    showBottomLine: Boolean = true,
    modifier: Modifier = Modifier,
) {
    Column(
        modifier = modifier.fillMaxWidth(),
        horizontalAlignment = Alignment.CenterHorizontally,
    ) {
        Text(
            text = itemDTO.name?:"",
            modifier = Modifier
                .padding(all = 13.dp)
        )
        if (showBottomLine){
            Divider(modifier = Modifier
                .height(0.5.dp)
                .background(colorGrayLine)
//                .background(Color(ColorUtils.getColor(R.color.gray_line)))
            )
        }
    }
}

@Preview(showBackground = true)
@Composable
fun previewListChooseItemView() {
    ListChooseItemView(itemDTO = ListItemDTO(name = "列表项"))
}